﻿<#include "../public/header.html">
    <div data-role="page" id="main" >
        <div data-role="header" data-position="fixed" >
            <h1>报考信息</h1>
        </div>

        <div data-role="content"  data-theme="a">
            <form id="add_to_project">
                <input type="hidden" name="project_id" id="project_id" readonly="readonly" value="${project_id!}">
                <input type="hidden" name="student_id" id="student_id" readonly="readonly" value="${po.id!}">
                <input type="hidden" name="dep_id" id="dep_id" readonly="readonly" value="${po.dep_id!}">
                <input type="hidden" name="class_id" id="class_id" readonly="readonly" value="${po.class_id!}">

                <label for="student_name">姓名:</label>
                <input type="text" name="student_name" id="student_name" value="${po.student_name!}">

                <label for="student_sb_cart">社保卡号:</label>
                <input type="text" name="student_sb_cart" id="student_sb_cart" value="${po.student_sb_cart!}">

                <label for="student_sb_ffd">社保卡发放地:</label>
                <input type="text" name="student_sb_ffd" id="student_sb_ffd" value="${po.student_sb_ffd!}"/>

                <label for="student_id_cart">身份证号:</label>
                <input type="text" name="student_id_cart" id="student_id_cart" onblur="changer_id_card()" value="${po.student_id_cart!}"/>

                <label for="student_sex">性别:</label>
                <fieldset id="student_sex" data-role="controlgroup" data-type="horizontal">
                        <input type="radio" name="student_sex" id="student_sex_8" value="8" <#if (po.student_sex!)==8> checked="checked"</#if>>
                        <label for="student_sex_8">女</label>
                        <input type="radio" name="student_sex" id="student_sex_9" value="9" <#if (po.student_sex!)==9> checked="checked"</#if>>
                        <label for="student_sex_9">男</label>
                </fieldset>

                <label for="student_birthday">出生日期:</label>
                <input type="text" name="student_birthday" id="student_birthday" value="${po.student_birthday!}"/>

                <label for="student_hj_address_name" class="select">户籍所在地:</label>

                <input type="hidden" name="student_hj_address" id="student_hj_address" value="${po.student_hj_address!}"/>
                <input type="text" name="student_hj_address_name" id="student_hj_address_name" readonly="readonly" />


                <label for="student_hj_address_detail">户藉地址:</label>
                <input type="text" name="student_hj_address_detail" id="student_hj_address_detail" value="${po.student_hj_address_detail!}">

                <label for="student_hk_type">户口性质:</label>
                <select name="student_hk_type" id="student_hk_type">
                     <option value="">请选择</option>

                </select>
                <label for="student_is_marray" class="select">婚姻状态:</label>
                <select name="student_is_marray" id="student_is_marray">
                     <option   value="">请选择</option>
                </select>
                <label for="student_nationality" class="select">民簇:</label>
                <select name="student_nationality" id="student_nationality">
                     <option   value="">请选择</option>
                </select>
                <label for="student_political" class="select">政治面貌:</label>
                <select name="student_political" id="student_political">
                     <option   value="">请选择</option>
                </select>
                <label for="at_company">所在单位:</label>
                <input type="text" name="at_company" id="at_company" value="${po.at_company!}">

                <label for="student_type" class="select">人员类型:</label>
                <select name="student_type" id="student_type">
                     <option   value="">请选择</option>
                </select>
                <label for="app_user_type" class="select">鉴定人员类别:</label>
                <select name="app_user_type" id="app_user_type">
                     <option   value="">请选择</option>
                </select>
                <label for="national_rank" class="select">国家职业资格等级:</label>
                <select name="national_rank" id="national_rank">
                     <option   value="">请选择</option>
                </select>
                <label for="up_national_rank" class="select">上一级职业资格级别:</label>
                <select name="up_national_rank" id="up_national_rank">
                     <option   value="">请选择</option>
                </select>

                <label for="is_not_testing_theory" class="select">是否免考理论:</label>
                <select name="is_not_testing_theory" id="is_not_testing_theory">
                     <option   value="">请选择</option>
                </select>
                <label for="student_cultural" class="select">文化程度:</label>
                <select name="student_cultural" id="student_cultural">
                     <option   value="">请选择</option>
                </select>

                <label for="student_high_school_record">最高学历专业:</label>
                <input type="text" name="student_high_school_record" id="student_high_school_record" value="${po.student_high_school_record!}">

                <label for="student_title">职称:</label>
                <input type="text" name="student_title" id="student_title" value="${po.student_title!}">

                <label for="student_duty">职务:</label>
                <input type="text" name="student_duty" id="student_duty" value="${po.student_duty!}">

                <label for="student_age_limit">职业年限:</label>
                <input type="text" name="student_age_limit" id="student_age_limit" value="${po.student_age_limit!}">

                <label for="student_duty_rank" class="select">专业技术职务级别:</label>
                <select name="student_duty_rank" id="student_duty_rank">
                     <option   value="">请选择</option>
                </select>

                <label for="student_work_age">工龄:</label>
                <input type="text" name="student_work_age" id="student_work_age" value="${po.student_work_age!}">

                <label for="student_email">电子邮箱:</label>
                <input type="text" name="student_email" id="student_email" value="${po.student_email!}">

                <label for="student_address">联系地址:</label>
                <input type="text" name="student_address" id="student_address" value="${po.student_address!}">

                <label for="student_tel_phone">联系电话:</label>
                <input type="text" name="student_tel_phone" id="student_tel_phone" value="${po.student_tel_phone!}">

                <label for="student_memo_1">基础信息1:</label>
                <input type="text" name="student_memo_1" id="student_memo_1" value="${po.student_memo_1!}">

                <label for="student_memo_1">基础信息2:</label>
                <input type="text" name="student_memo_2" id="student_memo_2" value="${po.student_memo_2!}">


                <label for="project_testing_type" class="select">项目考试类别:</label>
                <select name="project_testing_type" id="project_testing_type">
                     <option   value="">请选择</option>
                </select>
                <label for="project_testing_type_intro">项目考试类别说明:</label>
                <input type="text" name="project_testing_type_intro" id="project_testing_type_intro" value="${po.project_testing_type_intro!}">

                <a id="want_to" href="javascript:sub_want()" class="ui-btn ui-btn-d ui-corner-all">提交参与</a>
            </form>
        </div>

    </div>
    <script>

        function sub_want(){
            $.ajax({
                type:"post",
                url:"${root!}mobile/index/sub_want",
                data:$("#add_to_project").serialize(),
                dataType:"JSON",
                success:function(data){
                    alert(data.msg);
                    if(data.state==1){
                        window.location="${root!}mobile/index/my_project?id=${project_id}"
                    }
                }
            });
        }

        $(function(){


            if($("#student_hj_address").val()!=""){
                $.ajax({
                    type:"post",
                    url:"${root!}mobile/index/load_sys_pa_code_by_id?id="+$("#student_hj_address").val(),
                    dataType:"json",
                    success:function(data){
                        $("#student_hj_address_name").val(data.name);
                    }
                })
            }else if($("#student_id_cart").val()!=""){
                var id_cart = $("#student_id_cart").val();
                id_cart = id_cart.substr(0,6);
                $.ajax({
                    type:"post",
                    url:"${root!}mobile/index/load_hj_item?name="+id_cart+"&table=bk_student&field=student_hj_address",
                    dataType:"json",
                    success:function(data){
                        $("#student_hj_address_name").val(data.name);
                        $("#student_hj_address").val(data.id);
                    }
                })
            }


            load_hk();
            student_is_marray();
            student_nationality();
            student_political();
            student_type();
            app_user_type();
            national_rank();
            up_national_rank();
            is_not_testing_theory();
            student_cultural();
            student_duty_rank();
            project_testing_type();
        })

        function changer_id_card(){
            var id_cart = $("#student_id_cart").val();
            id_cart = id_cart.substr(0,6);
            $.ajax({
                type:"post",
                url:"${root!}mobile/index/load_hj_item?name="+id_cart+"&table=bk_student&field=student_hj_address",
                dataType:"json",
                success:function(data){
                    $("#student_hj_address_name").val(data.name);
                    $("#student_hj_address").val(data.id);
                }
            })
        }

        function project_testing_type(){
            $.ajax({
                type:"get",
                url:"${root!}mobile/index/sys_pa_code?table=bk_project_student&field=project_testing_type",
                dataType:"JSON",
                success:function(data){
                    buld_select("project_testing_type",data,"$(po.project_testing_type)");
                }
            });
        }
        function student_duty_rank(){
            $.ajax({
                type:"get",
                url:"${root!}mobile/index/sys_pa_code?table=bk_student&field=student_duty_rank",
                dataType:"JSON",
                success:function(data){
                    buld_select("student_duty_rank",data,"$(po.student_duty_rank)");
                }
            });
        }
        function student_cultural(){
            $.ajax({
                type:"get",
                url:"mobile/index/sys_pa_code?table=bk_student&field=student_cultural",
                dataType:"JSON",
                success:function(data){
                    buld_select("student_cultural",data,"$(po.student_cultural)");
                }
            });
        }
        function is_not_testing_theory(){
            $.ajax({
                type:"get",
                url:"${root!}mobile/index/sys_pa_code?table=common&field=boolean",
                dataType:"JSON",
                success:function(data){
                    buld_select("is_not_testing_theory",data,"$(po.is_not_testing_theory)");
                }
            });
        }
        function up_national_rank(){
            $.ajax({
                type:"get",
                url:"${root!}mobile/index/sys_pa_code?table=bk_student&field=up_national_rank",
                dataType:"JSON",
                success:function(data){
                    buld_select("up_national_rank",data,"$(po.up_national_rank)");
                }
            });
        }
        function national_rank(){
            $.ajax({
                type:"get",
                url:"${root!}mobile/index/sys_pa_code?table=bk_student&field=national_rank",
                dataType:"JSON",
                success:function(data){
                    buld_select("national_rank",data,"$(po.national_rank)");
                }
            });
        }
        function app_user_type(){
            $.ajax({
                type:"get",
                url:"${root!}mobile/index/sys_pa_code?table=bk_student&field=app_user_type",
                dataType:"JSON",
                success:function(data){
                    buld_select("app_user_type",data,"$(po.app_user_type)");
                }
            });
        }
        function student_type(){
            $.ajax({
                type:"get",
                url:"${root!}mobile/index/sys_pa_code?table=bk_student&field=student_type",
                dataType:"JSON",
                success:function(data){
                    buld_select("student_type",data,"$(po.student_type)");
                }
            });
        }
        function student_political(){
            $.ajax({
                type:"get",
                url:"${root!}mobile/index/sys_pa_code?table=bk_student&field=student_political",
                dataType:"JSON",
                success:function(data){
                    buld_select("student_political",data,"$(po.student_political)");
                }
            });
        }
        function load_hj(){
            $.ajax({
                type:"get",
                url:"${root!}mobile/index/sys_pa_code?table=bk_student&field=student_hj_address",
                dataType:"JSON",
                success:function(data){
                    buld_select("student_hj_address",data,"$(po.student_hj_address)");
                }
            });
        }

        function load_hk(){
            $.ajax({
                type:"get",
                url:"${root!}mobile/index/sys_pa_code?table=bk_student&field=student_hk_type",
                dataType:"JSON",
                success:function(data){
                    buld_select("student_hk_type",data,"$(po.student_hk_type)");
                }
            });
        }

        function student_is_marray(){
            $.ajax({
                type:"get",
                url:"${root!}mobile/index/sys_pa_code?table=bk_student&field=student_is_marray",
                dataType:"JSON",
                success:function(data){
                    buld_select("student_is_marray",data,"$(po.student_is_marray)");
                }
            });
        }
        function student_nationality(){
            $.ajax({
                type:"get",
                url:"mobile/index/sys_pa_code?table=bk_student&field=student_nationality",
                dataType:"JSON",
                success:function(data){
                    buld_select("student_nationality",data,"$(po.student_nationality)");
                }
            });
        }

        function buld_select(id,data,seleced){
            var str = "";
            $.each(data,function(i,item){
                if(seleced==item.id){
                    str +='<option value="'+item.id+'" selected>'+item.name+'</option>'
                }else{
                    str +='<option value="'+item.id+'">'+item.name+'</option>'
                }
            });

            $("#"+id).append(str);
        }

    </script>

<#include "../public/footer.html">